package advance.conditional;

import advance.conditional.condition.LinuxCondition;
import advance.conditional.condition.WindowsCondition;
import advance.conditional.service.LinuxListService;
import advance.conditional.service.WindowsListService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @Description: TODO
 * @Author: chris_cai@enable-ets.com
 * @Since: 2018年10月11日
 */
@Configuration
public class ConditionConfig {

    @Bean
    @Conditional(WindowsCondition.class)
    public WindowsListService windowsListService() {
        return new WindowsListService();
    }

    @Bean
    @Conditional(LinuxCondition.class)
    public LinuxListService linuxListService() {
        return new LinuxListService();
    }
}
